< previous page page_818 next page >

Page 818
Type.gifListing 21.21. Selecting the Access Rights form.
Private Sub SSTab1_Click(PreviousTab As Integer)
    '
    ' handle tab changes
    '
    Select Case PreviousTab
        Case 0 ' leaving users
            lblUserID = txtField(0)
            lblUserName = txtField(2)
            accLoadLists
        Case 1 ' leaving access
    End Select
    '
End Sub
Then add code for the new accLoadLists method. This is the code that actually loads the grid boxes with live data (see Listing 21.22).
Type.gifListing 21.22. Coding the accLoadLists method.
Public Sub accLoadLists()
    '
    ' load form dbgrids
    '
    strSQLDefault = "SELECT Object,[Level],UserID FROM secAccess WHERE
UserID='DEFAULT' ORDER BY Object"
    strSQLUserID = "SELECT Object,[Level],UserID FROM secAccess WHERE UserID =
'" & lblUserID & "' ORDER BY Object"
    '
    dtaDefault.DatabaseName = strDBName
    dtaDefault.RecordSource = strSQLDefault
    dbgDefault.Caption = "Secure Objects"
    dtaDefault.Refresh
    dbgDefault.ReBind
    dbgDefault.Columns(0).Width = 1440
    dbgDefault.Columns(1).Width = 600
    '
    dtaUserID.DatabaseName = strDBName
    dtaUserID.RecordSource = strSQLUserID
    dbgUserID.Caption = "User Access"
    dtaUserID.Refresh
    dbgUserID.ReBind
    dbgUserID.Columns(0).Width = 1440
    dbgUserID.Columns(1).Width = 600
    '
End Sub
Next, add the code from Listing 21.23 behind the cmdAccess button array. This control array handles all the routines that add and delete rights objects and set the access level for the rights objects.

 
< previous page page_818 next page >

If you like this book, buy it!